package com.hr.String不可变性;

import org.junit.Test;

/**
 * @program: leetcode
 * @description:
 * @author: HuRan QQ1345122890
 * @create: 2021-03-02 20:35
 */
public class StringInternTest2 {
    public static void main(String[] args) {
        String s3 = new String("1") + new String("1");
        String s4 = "11";
        String intern = s3.intern();
        System.out.println(intern == s4);//true
        System.out.println(s3 == s4);//false

    }

}